<?php
//global_config::get_instance()->add_server_class("SoapValueChar","soap_value_char");
global_config::get_instance()->add_server_class("SoapValueString","soap_value_char");
class soap_value_char
{
	public $Value ='';
	
	/**
	 * Save to db
	 *
	 * 
	 */
	public function save_to_db() {
		$dba = db_adapter::get_instance();
		
		$message = new message();
		$message->message_text->set_value($this->Value);
		
		$dba->save_unique($message);
		return $message->message_id->get_value();
	}
	
	/**
	 * Load from db
	 * 
	 * 
	 */
	public function load_from_db($message_id)
	{
		$message = new message();
		$message->message_id->set_value($message_id);

		$dba = db_adapter::get_instance();
		$criteria = new query_criteria();
		$criteria->add_criterion($message->message_id,criterion_type::$equal,$message_id);
		$dba->load($message,$criteria);
		$this->Value = $message->message_text->get_value();
	}
}
?>